package com.captjack.core.controller;

import com.captjack.core.model.SysDict;
import com.captjack.core.validator.HelloValidator;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Capt Jack
 * @date 2018/5/11
 */
public class IndexController extends Controller {

    private static final Logger logger = LoggerFactory.getLogger(IndexController.class);

    public void index() {
        render("/index.html");
    }

    /**
     * 配置校验器
     */
    @Before(HelloValidator.class)
    public void hello() {
        SysDict sysDict = SysDict.dao.findById("18");
        logger.info(sysDict.toJson());
        renderJson(sysDict);
    }

}
